package com.kksoft.android.xiaoliaobaike.fetcher.thread;

import android.os.Handler;
import android.os.Message;

import com.kksoft.android.xiaoliaobaike.Const;

public class FetchArticlePageRangeThread extends FetchArticleThread {

	private int seriesId;

	public FetchArticlePageRangeThread(Handler articleHandler, int seriesId) {
		super(articleHandler, null);
		this.seriesId = seriesId;
	}

	public void run() {
		int[] parsePageRange = { 0, 0 };
		try {
			parsePageRange = fetchPageRange(seriesId);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			// 获取数据
			Message toSend = articleHandler.obtainMessage(Const.MSG_ARTICLE_PAGE_RANGE);
			toSend.arg1 = parsePageRange[0];
			toSend.arg2 = parsePageRange[1];
			toSend.obj = seriesId;
			articleHandler.sendMessage(toSend);
		}
	}
}